<?php

class Raid_Form_Create extends Pldkp_Form
{ 
    public function init()
    {   
        $this->setName('create_raid');
        
        $dateTimePicker = new Pldkp_Form_Element_DateTimePicker('a_datetime_picker');
        $dateTimePicker->setLabel('Datetime:');
        
        $auto = new Pldkp_Form_Element_AutoSelector('user_id_by_email');
        $auto->setLabel('User id by email:')
             ->setTable('User_Model_Users')
             ->setColumns('id', 'email')
             ->setRequired(true)
             ->setJQueryParams(array(
                'url' => Zend_Controller_Front::getInstance()->getBaseUrl() . '/user/ajax/get-users',
                'mustMatch' => true,
                )); 
             
        $auto2 = new Pldkp_Form_Element_AutoSelector('user_id_by_name');
        $auto2->setLabel('User id by name:')
              ->setTable('User_Model_Users')
              ->setColumns('id', 'name')
              ->setRequired(true)
              ->setJQueryParams(array('url' => Zend_Controller_Front::getInstance()->getBaseUrl() . '/user/ajax/get-users'));
             
        $element = new Zend_Form_Element_Text('something');
        $element->setLabel('A label:')
                ->setDescription('A description')
                ->setRequired(true);
        
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Submit');
        
        $this->addElements(array($dateTimePicker, $auto, $auto2, $element, $submit));
    }
}